<template>
	<view>
		<view class="specification">
			<view class="moreFication" v-for="(item,index) in inventoryBomList" :key="index">
				<!-- 名称 -->
				<view>
					<view class="box"></view>
					<text class="ming">{{item.pieceName}} <text
							style="margin-left: 20rpx;">X{{item.pieceAmount}}</text></text>
				</view>
				<!-- 测绘图纸 -->
				<view>
					<!-- 规格 -->
					<text class="spacing">
						<text class="daswen">规格：</text>
						<text class="daswenti">
							{{item.pieceSpec== "" || item.pieceSpec== null?"-":item.pieceSpec}}</text>
					</text>
					<view class="paper">
						<text v-if="item.isMapping>0" @click="deviceAccessories">测绘图纸：</text>
						<image class="img" src="http://106.14.56.171:15016/images/materialDetail/pdf.png"
							v-if="item.isMapping>0" @click="deviceAccessories"></image>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				epCode: '',
				inventoryBomList: []
			}
		},

		onLoad(options) {
			this.epCode = options.epCode
			this.getinventoryBom()
		},
		methods: {
			getinventoryBom() {
				this.$http.get('api/EqEquipment/GetBom?epCode=' + this.epCode).then(res => {
					this.inventoryBomList = res;
				})
			},
			// 设备附件
			deviceAccessories() {
				uni.showToast({
					title: '请线下联系索取',
					icon: 'none',
					duration: 2000
				});
			}
		}
	}
</script>

<style lang="less" scoped>
	.specification {
		margin: 20rpx 20rpx 0 20rpx;
		width: 96%;
		border-radius: 16rpx;
		background-color: #ffffff;

		.moreFication {
			margin: auto;
			padding: 20rpx 0 0 0;
			width: 90%;

			// 名称
			>view:nth-child(1) {
				height: 60rpx;
				display: flex;
				align-items: center;
				// background-color: palegoldenrod;

				.box {
					margin-left: 20rpx;
					width: 12rpx;
					height: 35rpx;
					background-color: #D36778;
				}

				.ming {
					font-size: 30rpx;
					font-family: '微软雅黑 Bold', '微软雅黑';
					font-weight: 700;
					font-style: normal;
				}

				>text {
					margin-left: 20rpx;
				}
			}

			// 测绘图纸
			>view:nth-child(2) {
				width: 100%;
				height: 100rpx;

				.paper {
					width: 550rpx;
					margin-left: 53rpx;
					padding: 0 0 20rpx 0;
					margin-top: 10rpx;
					display: flex;
					align-items: center;
					border-bottom: 2rpx dashed #CFCFCF;

					>text {
						font-size: 26rpx;
						color: #999999;
					}
				}
			}

		}
	}

	// 间距
	.spacing {
		margin-left: 53rpx;

		.daswen {
			font-size: 26rpx;
			color: #999999;
		}

		.daswenti {
			font-size: 26rpx;
			color: #333333;
		}
	}

	.img {
		width: 20rpx;
		height: 28rpx;
		margin-left: 20rpx;
	}
</style>
